'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    const page = this.ctx.query.page|| 1;
    const subscribeList = await this.ctx.service.subscribe.subscribeIndex(page,15);
    var noticeList = await this.ctx.service.bbs.bbsListSimple(1,10,3);
    var bannerList = await this.ctx.service.banner.bannerList('index_banner');
    var memberList = await this.ctx.service.banner.bannerList('vip_area');
    var data = {
      videoData:subscribeList,
      noticeList:noticeList,
      bannerList:bannerList,
      memberList:memberList,
    };
    await this.ctx.render('index.html',{data:data});
  }

  
  async recruit(){
    let data ={     
      navIndex:8
    }

    await this.ctx.render('page/recruit/recruit.html', data);
  }
}

module.exports = HomeController;
